/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("ware_warehousebill",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Warehouse.IServices;
using VOL.Warehouse.IRepositories;
using Microsoft.EntityFrameworkCore;

namespace VOL.Warehouse.Controllers
{
    public partial class ware_warehousebillController
    {
        private readonly Iware_warehousebillService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly Iware_warehousebilllistRepository  _warehousebilllistRepository;

        [ActivatorUtilitiesConstructor]
        public ware_warehousebillController(
            Iware_warehousebillService service,
            IHttpContextAccessor httpContextAccessor,
            Iware_warehousebilllistRepository warehousebilllistRepository
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
            _warehousebilllistRepository = warehousebilllistRepository;
        }

        [Route("getDetailRows"), HttpGet]
        public async Task<IActionResult> GetDetailRows(int WareHouseBill_Id)
        {
            var rows = await _warehousebilllistRepository.FindAsIQueryable(x => x.WareHouseBill_Id == WareHouseBill_Id).ToListAsync();
            return JsonNormal(rows);

        }
    }
}
